package com.ch999.detect.View.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.ch999.detect.R;
import com.ch999.detect.View.SelectStartDialog;


/**
 * Created by Administrator on 2016/12/13 0013.
 */

public class DetectConnDialog extends SelectStartDialog implements View.OnClickListener {

    View.OnClickListener listener;
    private TextView tvTitle;
    private String format;
    private String string;

    public DetectConnDialog(Context context, View.OnClickListener listener) {
        super(context);
        this.listener = listener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_detect_conn_layout);


        string = mContent.getString(R.string.dialog_tilte);

        tvTitle = (TextView) findViewById(R.id.tv_title);

        findViewById(R.id.btn_0).setOnClickListener(this);
        findViewById(R.id.btn_1).setOnClickListener(this);

    }


    public void show(int posaion) {
        super.show();

        tvTitle.setText(String.format(string, posaion + ""));

    }

    @Override
    public void onClick(View view) {
        if (listener != null) {
            dismiss();
            listener.onClick(view);
        }
    }
}
